<?php
include_once '../inc/config.inc.php';
include_once '../inc/mysqli.inc.php';
include_once '../inc/tool.inc.php';
$link=connect();
$memberid=is_login($link);

$template='论坛首页';
include_once 'inc/header.inc.php';
?>
        <div class="issue">
            <div class="wrap">
                <div class="topic">热门动态</div>
                <div class="detail">[A队]项目练习进行中...</div>
            </div>
        </div>
        <div class="plate">
            <div class="wrap">
                <?php
                $queryf="select *from fatherModule order by sort desc";
                $resultf=execute($link,$queryf);
                while($dataf=mysqli_fetch_assoc($resultf)){
                    $dataf=dehtml($dataf);
                    echo "<div class='subt'><a href='parentList.php?id={$dataf['id']}' style='color:#488fce;'>{$dataf['moduleName']}</a></div>";
                    $queryc="select *from childModule where referid={$dataf['id']}";
                    $resultc=execute($link,$queryc);
                    if(!mysqli_num_rows($resultc)){
                        echo "<div class='detail'>暂无子板块...</div>";
                    }else{
                        echo "<div class='detail clear-float'>";
                        while($datac=mysqli_fetch_assoc($resultc)){
                            $datac=dehtml($datac);
                            $queryct="select *from content where cmid={$datac['id']}";
                            $resultct=execute($link,$queryct);
                            $post=mysqli_num_rows($resultct);
                            $queryct="select *from content where cmid={$datac['id']} and time>curdate()";//curdate()mysql内置函数
                            $resultct=execute($link,$queryct);
                            $today=mysqli_num_rows($resultct);
                            
                           echo   "<div class='box-new'><h2><a href='childList.php?id={$datac['id']}'>{$datac['moduleName']}</a><span>(今日{$today})</span></h2>帖子：{$post}</div>";
                        }
                        echo " </div>";
                    }
                  
                }

                ?>


          
                </div>
            </div>
        </div>




<?php
include_once 'inc/footer.inc.php';
?>